/*
 * modem_driver.h
 *
 *  Created on: 10/07/2013
 *      Author: Santiago Carmona Meco
 */

#ifndef MODEM_DRIVER_H_
#define MODEM_DRIVER_H_

#include <public/basic_types.h>
#include <public/uart_dev_getchar.h>
#include <public/stdio.h>

#define BUFFER_SIZE 8224
#ifdef CONFIG_INTA_RTU
	#define UART_IRQ_NUM 0x13
#else
	#define UART_IRQ_NUM 0x12
#endif
#define SSI_BUFFER 0
#define SGI_BUFFER 1

typedef struct
{
		byte_t buffer[15000];
		uint16_t readIndex;
		uint16_t writeIndex;
		uint16_t bytesWritten;
}
ModemDriverBuffer_t;


extern ModemDriverBuffer_t bufferOfDevices[2];

extern uint8_t bufferOfDeviceIndex;


void init_modem_driver (void);

void clear_sgi_buffer (void);

void clear_ssi_buffer (void);

void clear_string (byte_t * pString, uint32_t length);

void modem_driver_read_handler(void);



#endif /* MODEM_DRIVER_H_ */

